/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;

/**
 * <p>Project: jse2204 - Arr7
 * <p>Powered by webrx On 2022-09-06 14:49:25
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Arr7 {
    public static void main(String[] args) {
        String[] ns = {"李四", "张三丰", "李强", "王五", "张三", "赵丽", "周五"};
        System.out.println(Arrays.toString(ns));


        Arrays.sort(ns);
        System.out.println(Arrays.toString(ns));


        Arrays.sort(ns, (a, b) -> b.compareTo(a));
        System.out.println(Arrays.toString(ns));


        Arrays.sort(ns, (a, b) -> Math.random() > .5 ? 1 : -1);
        Arrays.sort(ns, (a, b) -> Math.random() > .5 ? 1 : -1);
        Arrays.sort(ns, (a, b) -> Math.random() > .5 ? 1 : -1);
        Arrays.sort(ns, (a, b) -> Math.random() > .5 ? 1 : -1);
        System.out.println(Arrays.toString(ns));

        System.out.println((int) '周');
        System.out.println((int) '五');
        System.out.println((int) '张');
        System.out.println((int) '三');
    }
}
